package com.zcs.shardingjdbc.controller;
import com.zcs.shardingjdbc.entity.User;
import com.zcs.shardingjdbc.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zcs
 */
@RestController
public class UserController {
	
	@Resource
	private UserService userService;
	
	@GetMapping("/add")
	public Object add() {
		for (long i = 0; i < 100; i++) {
			User user = new User();
			user.setCity("深圳");
			user.setName("李四");
			userService.save(user);
		}
		return "success";
	}
	
}
